package Lab02.test03;

/**
 * Created by Administrator on 2017/10/12.
 */
public class Student {
    //属性：计算机成绩、数学成绩、英语成绩。
    float computerScore;
    float matchScore;
    float englishScore;
    //行为:总分、平均分、最高分、最低分，并且可以输出一个学生的完整信息。
    float sum() {
        return computerScore+matchScore+englishScore;
    }
   float average(){
        return(computerScore+matchScore+englishScore)/3;
   }
    private float maxScore(){
       float maxScore=computerScore>matchScore?computerScore:matchScore;
              maxScore=maxScore>englishScore?matchScore:englishScore;
              return maxScore;
    }
    private float minScore(){
        float minScore=computerScore>matchScore?computerScore:matchScore;
        minScore=minScore>englishScore?matchScore:englishScore;
        return minScore;
    }
    void printstudent(){
        System.out.println("总分:"+sum());
        System.out.println("平均分:"+average());
        System.out.println("最高分:"+maxScore());
        System.out.println("最低分:"+minScore());
    }

}

